function getFileType(fileName) {
  // 根据后缀判断文件类型
  let fileSuffix = "";
  // 结果
  let result = "";
  try {
    let flieArr = fileName.split(".");
    fileSuffix = flieArr[flieArr.length - 1];
  } catch (err) {
    fileSuffix = "";
  }
  // fileName无后缀返回 false
  if (!fileSuffix) {
    result = false;
    return result;
  }
  // 图片格式
  let imglist = ["png", "jpg", "jpeg"];
  // 进行图片匹配
  result = imglist.some(function(item) {
    return item == fileSuffix;
  });
  if (result) {
    result = "png";
    return result;
  }
  // 匹配txt
  let txtlist = ["txt"];
  result = txtlist.some(function(item) {
    return item == fileSuffix;
  });
  if (result) {
    result = "txt";
    return result;
  }
  // 匹配 excel
  let excelist = ["xls", "xlsx"];
  result = excelist.some(function(item) {
    return item == fileSuffix;
  });
  if (result) {
    result = "excel";
    return result;
  }
  // 匹配 word
  let wordlist = ["doc", "docx"];
  result = wordlist.some(function(item) {
    return item == fileSuffix;
  });
  if (result) {
    result = "word";
    return result;
  }
  // 匹配 pdf
  let pdflist = ["pdf"];
  result = pdflist.some(function(item) {
    return item == fileSuffix;
  });
  if (result) {
    result = "pdf";
    return result;
  }
  // 匹配 ppt
  let pptlist = ["ppt"];
  result = pptlist.some(function(item) {
    return item == fileSuffix;
  });
  if (result) {
    result = "ppt";
    return result;
  }
  // 匹配 视频
  let videolist = ["mp4", "m2v", "mkv", "video","mov"];
  result = videolist.some(function(item) {
    return item == fileSuffix;
  });
  if (result) {
    result = "mp4";
    return result;
  }
  // 匹配 音频
  let radiolist = ["mp3", "wav", "wmv"];
  result = radiolist.some(function(item) {
    return item == fileSuffix;
  });
  if (result) {
    result = "mp3";
    return result;
  }
  // 压缩包
  let zipList = ["zip", "rar"];
  result = zipList.some(function(item) {
    return item == fileSuffix;
  });
  if (result) {
    result = "zip";
    return result;
  }  
  // 其他 文件类型
  result = "other";
  return result;
}
export default {
	getFileType
}